<script>
	export default {
		globalData: {
			isIos: false,
			platformStatus: 1,
			statusBarHeight: 20,
			//小程序配置的接口请求域名，为项目部署的服务器路径
			apiBaseUri: "http://stu.manage.com:8098/api",
			apiHost: "http://stu.manage.com:8098",
			//小程序appi
			appid: '',
			//前端上传图片补全域名，如oss的https://example.oss-cn-shanghai.aliyuncs.com，或https://www.example.com
			storageBaseUri: "",
			//阿里OSS的上传路径
			uploadOssStatus: false,
			alioss: {
				endpoint: ''
			},
		},
		onLaunch: function() {
			let app = this;
			uni.getSystemInfo({
				success: res => {
					if (res.platform == 'ios' || res.platform == 'mac') {
						app.globalData.isIos = true;
					}
					if (res.statusBarHeight < 20) {
						app.globalData.statusBarHeight = 20;
						return;
					}
					app.globalData.statusBarHeight = res.statusBarHeight;
				}
			});
			app.$core.onRequestComplete(function(ret, response) {
				if (ret && ret.code === 401) {
					if (app.$user.getUserinfo()) {
						app.$user.logout();
						uni.reLaunch({
							url: '/pages/login/login1'
						});
						uni.showToast({
							title: '登录过期,请重新登录',
							icon: 'none'
						});
					}
				}

			});
			setTimeout(function() {
				// app初始化完成后再执行
				//#ifdef MP-WEIXIN
				//console.log('app初始化完成后再执行->wxLogin');
				app.$user.wxLogin();
				//#endif
			}, 1);
		},
		onShow: function() {
			let app = this;
			//支付开关
			app.$core.get({
				url: 'xiluedu.config/config',
				data: {
					name: 'shopinfo'
				},
				success: ret => {
					//if(ret.data.vip_status != 'undefined'){
					app.globalData.platformStatus = ret.data.vip_status || 1;
					console.log(app.globalData.platformStatus)
					//}
				},
				loading: false
			});
		},
		onHide: function() {
			console.log('App Hide');
		}
	};
</script>

<style>
	/*每个页面公共css */
	@import url('/static/css/global.css');
	@import url('/static/css/iconfont.css');

	.bold {
		font-weight: bold;
	}

	.bc-w {
		background-color: #fff;
	}

	.txt-c {
		text-align: center;
	}

	.body {
		background-color: #f6f6f6;
		min-height: 100vh;
	}

	.sub {
		color: #999;
	}

	.flex {
		display: flex;
	}

	.between {
		display: flex;
		justify-content: space-between;
	}

	.mt10 {
		margin-top: 10px;
	}

	.mt20 {
		margin-top: 20px;
	}

	.mt30 {
		margin-top: 30px;
	}

	.mt40 {
		margin-top: 40px;
	}

	.mt50 {
		margin-top: 50px;
	}

	.mt60 {
		margin-top: 60px;
	}

	.mt70 {
		margin-top: 70px;
	}

	.mt80 {
		margin-top: 80px;
	}

	.mb10 {
		margin-bottom: 10px;
	}

	.mb20 {
		margin-bottom: 20px;
	}

	.mb30 {
		margin-bottom: 30px;
	}

	.mb40 {
		margin-bottom: 40px;
	}

	.mb50 {
		margin-bottom: 50px;
	}

	.mb60 {
		margin-bottom: 60px;
	}

	.mb70 {
		margin-bottom: 70px;
	}

	.mb80 {
		margin-bottom: 80px;
	}

	.ml10 {
		margin-left: 10px;
	}

	.ml20 {
		margin-left: 20px;
	}

	.ml30 {
		margin-left: 30px;
	}

	.ml40 {
		margin-left: 40px;
	}

	.ml50 {
		margin-left: 50px;
	}

	.ml60 {
		margin-left: 60px;
	}

	.ml70 {
		margin-left: 70px;
	}

	.ml80 {
		margin-left: 80px;
	}

	.mr10 {
		margin-right: 10px;
	}

	.mr20 {
		margin-right: 20px;
	}

	.mr30 {
		margin-right: 30px;
	}

	.mr40 {
		margin-right: 40px;
	}

	.mr50 {
		margin-right: 50px;
	}

	.mr60 {
		margin-right: 60px;
	}

	.mr70 {
		margin-right: 70px;
	}

	.mr80 {
		margin-right: 80px;
	}

	.pt10 {
		padding-top: 10px;
	}

	.pt20 {
		padding-top: 20px;
	}

	.pt30 {
		padding-top: 30px;
	}

	.pt40 {
		padding-top: 40px;
	}

	.pt50 {
		padding-top: 50px;
	}

	.pt60 {
		padding-top: 60px;
	}

	.pt70 {
		padding-top: 70px;
	}

	.pt80 {
		padding-top: 80px;
	}

	.pt10 {
		padding-bottom: 10px;
	}

	.pt20 {
		padding-bottom: 20px;
	}

	.pt30 {
		padding-bottom: 30px;
	}

	.pt40 {
		padding-bottom: 40px;
	}

	.pt50 {
		padding-bottom: 50px;
	}

	.pt60 {
		padding-bottom: 60px;
	}

	.pt70 {
		padding-bottom: 70px;
	}

	.pt80 {
		padding-bottom: 80px;
	}

	.pt10 {
		padding-left: 10px;
	}

	.pt20 {
		padding-left: 20px;
	}

	.pt30 {
		padding-left: 30px;
	}

	.pt40 {
		padding-left: 40px;
	}

	.pt50 {
		padding-left: 50px;
	}

	.pt60 {
		padding-left: 60px;
	}

	.pt70 {
		padding-left: 70px;
	}

	.pt80 {
		padding-left: 80px;
	}

	.pt10 {
		padding-right: 10px;
	}

	.pt20 {
		padding-right: 20px;
	}

	.pt30 {
		padding-right: 30px;
	}

	.pt40 {
		padding-right: 40px;
	}

	.pt50 {
		padding-right: 50px;
	}

	.pt60 {
		padding-right: 60px;
	}

	.pt70 {
		padding-right: 70px;
	}

	.pt80 {
		padding-right: 80px;
	}
</style>